# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ctypes-sh
pkgver=159.62ec33a
pkgrel=1
pkgdesc='Allows you to call routines in shared libraries from within bash.'
groups=('blackarch' 'blackarch-reversing' 'blackarch-exploitation')
arch=('x86_64')
url='https://github.com/taviso/ctypes.sh'
license=('MIT')
depends=('bash' 'elfutils' 'libelf' 'libdwarf' 'libffi')
makedepends=('git')
source=("$pkgname::git+https://github.com/taviso/ctypes.sh")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  ./autogen.sh
  ./configure --prefix=/usr
  make
}

package() {
  cd $pkgname

  make DESTDIR="$pkgdir/" install
  mv "$pkgdir/usr/bin/ctypes.sh" "$pkgdir/usr/bin/$pkgname"
}

